﻿function OpenDialog(url, title, width, height) {
    layer.open({
        type: 2,
        title: [
            title,
            'border:none; background:#0099CC; color:#fff;'
        ],
        fix: false,
        shadeClose: false,
        shade: [0.6, '#dfdfdf'],
        maxmin: true,
        area: [width + 'px', height + 'px'],
        content: url,
    });
}

function CloseDialog() {
    var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}

function PCloseDialog(dialog) {
    debugger;
    var index = layer.getFrameIndex(dialog.name);
    layer.close(index);
}


function ConirmDialog(options) {
    layer.confirm(options.msg,
    {
        btn: options.btnNames || ["确定", "关闭"],
        shade: [0.6, '#dfdfdf'],
        area: ['auto', 'auto'],
    },
    function () {
        options.yes.call();
        layer.close();
    }
    );
}

function SysMessage(msg, time) {
    layer.msg(msg || "操作成功！", { icon: 1, shade: [0.6, '#dfdfdf'], time: time || 1500 });
}

function SysAlert(msg) {
    layer.alert(msg || "发生异常！", {
        shade: [0.6, '#dfdfdf'],
    });
}

function CloseAndShowMessage(msg, time)
{
    parent.layer.msg(msg || "操作成功！", { icon: 1, shade: [0.6, '#dfdfdf'], time: time || 1500 });
    CloseDialog();
}